package com.rao.quartz.controller;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: raoguang
 * @Date: 2022/09/29/16:11
 * @Description:
 */
@RestController
public class TestController {

    @GetMapping("/health")
    public String health() {
        return "I'm health!!!";
    }

    @GetMapping("/job")
    @Scheduled(cron = "0/5 * * * * ?")
    public void job() {
        System.out.println("每隔5秒执行一次！！！");
    }
}
